package org.hhchat.leetcode.array;

import java.util.Arrays;

/**
 * Created by hh23485 on 2017/6/25.
 */
public class code561 {
    public static class Solution {
        public int arrayPairSum(int[] nums) {
            Arrays.sort(nums);
            int count=0;
            for(int i=0;i<nums.length;i+=2){
                count+=nums[i];
            }
            return count;
        }
    }
}
